//
//  ApplyOpenInvoicVC.m
//  NtoccShipper
//
//  Created by mac on 2019/12/16.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "ApplyOpenInvoicVC.h"
#import "OpenInvoiceInfoModel.h"
#import "AddNewInvoiceInfoVC.h"

@interface ApplyOpenInvoicVC ()
@property (nonatomic,strong) CJLabel *labInvoicHead;
@property (nonatomic,strong) CJLabel *labTaxNum;
@property (nonatomic,strong) CJLabel *labBaseBank;
@property (nonatomic,strong) CJLabel *labBaseAccount;
@property (nonatomic,strong) CJLabel *labRegsiterAddr;
@property (nonatomic,strong) CJLabel *labRegsiterPhone;
//@property (nonatomic,strong) OpenInvoiceInfoModel *model;
@end

@implementation ApplyOpenInvoicVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self setTitleName:@"发票索取详情"];
    [self setBackLeftButton:@""];
    [self createTopView];
  
}

//- (void)loadData{
//
//    NSString *strURL = CJStringWithFormat(@"%@/ntocc-tms-api/invoiceMessage",CJBaseUrl);
//    NSDictionary *dicPar = @{@"type":@"0",
//                             @"isInvoiceDefault":@"1",
//    };
//
//    WS(ws);
//    [[HDNetworking sharedHDNetworking] GET:strURL parameters:dicPar success:^(id  _Nonnull responseObject) {
//
//        DLog(@"++++++++%@",responseObject);
//        NSArray *list = responseObject[@"records"];
//        if (list.count > 0) {
//            NSError * error ;
//            ws.model = [[OpenInvoiceInfoModel alloc]initWithDictionary:list[0] error:&error];
//            [ws createTopView];
//        }else{
//            self.labInvoicHead.text = @"";
//            self.labTaxNum.text = @"";
//            self.labBaseBank.text = @"";
//            self.labBaseAccount.text = @"";
//            self.labRegsiterAddr.text = @"";
//            self.labRegsiterPhone.text = @"";
//        }
//
//    } failure:^(NSError * _Nonnull error) {
//        DLog(@"++++++++%@",error);
//    }];
//
//}

/// 创建tableview 等
- (void)createTopView{

    CGRect rcFrame = CGRectMake(0, kTopHeight, [[UIScreen mainScreen] bounds].size.width, 0);
    FlexFrameView *header = [[FlexFrameView alloc] initWithFlex:@"ApplyOpenInvoicTopView" Frame:rcFrame Owner:self];
    header.flexibleHeight = YES;

    self.labInvoicHead.text = self.model.invoiceTitle;
    self.labTaxNum.text = self.model.taxRegistrationNumber;
    self.labBaseBank.text = self.model.bankName;
    self.labBaseAccount.text = self.model.accountNumber;
    self.labRegsiterAddr.text = self.model.registeredAddress;
    self.labRegsiterPhone.text = self.model.registeredFixedPhone;
    [header layoutIfNeeded];
    [self.view addSubview:header];
}

//- (void)btnApplyInvioceAction{
//
//    NSString *strURL = CJStringWithFormat(@"%@/ntocc-tms-api/invoice",CJBaseUrl);
//    NSDictionary *dicPar = @{@"detailCodes":self.strCode,
//    };
//
//    WS(ws);
//    [[HDNetworking sharedHDNetworking] POST:strURL parameters:dicPar success:^(id  _Nonnull responseObject) {
//
//        DLog(@"++++++++%@",responseObject);
//        if (ws.blockSucess) {
//            ws.blockSucess(@"");
//        }
//
//    } failure:^(NSError * _Nonnull error) {
//        DLog(@"++++++++%@",error);
//
//    }];
//
//
//}
//- (void)btnChangeInvioceAction{
//    WS(ws);
//    AddNewInvoiceInfoVC *vc = [[AddNewInvoiceInfoVC alloc]init];
//    vc.strCode = self.model.code;
//    vc.isChange = YES;
//    vc.blockSuccess = ^(id anyObject) {
//        [ws loadData];
//    };
//    [self pushVc:vc];
//}

@end
